package com.neusoft.ch7.hw.test03;

public class Circle extends Shape {

	// 子类新增属性
	private double radius;

	@Override
	public double calculateArea() {
		// 计算面积
		return Math.PI * radius * radius;
	}

	@Override
	public double calculatePer() {
		// 计算周长
		return 2 * Math.PI * radius;
	}

	@Override
	public void showAll() {
		// 输出所有信息
		System.out.println("当前形状是圆形：半径=" + this.radius + ",周长=" + this.calculatePer() + ",面积=" + this.calculateArea()
				+ ",颜色=" + this.calculateColor());

	}

	public Circle() {
		super();
	}

	public Circle(double radius, String color) {
		super(color);
		this.radius = radius;
	}

	public double getRadius() {
		return radius;
	}

	public void setRadius(double radius) {
		this.radius = radius;
	}

}
